/**
 * Class:	Date
 * 
 * Variables:
 * 
 *		private int year;
 *		private int month;
 *		private int day;
 * 
 * Remarks:
 * 
 * 		Variables are set to private and can be accessed
 * 		only through their getters and setters.
 * 
 * @author ( Sharmaine Lim )
 * @version ( 2013-02-28 // YYYY-MM-DD )
 */

package models;

public class Date {
	
	/* Instance Variables */
	private int year;
	private int month;
	private int day;
	
	
	
	/**
	 * Constructors
	 */
	public Date( int year, int month, int day ) {
		this.year = year;
		this.month = month;
		this.day = day;
	}
    
    
    
    /**
     *  To String
     *  	- Turns the date into a String with a YYYY-MM-DD format
     *  
     *  Parameters
     *		- n/a
     *	
     *	Returns
     *		- String: YYYY-MM-DD
     */
	public String toString() {
		return this.year + "-" + this.month + "-" + this.day;
	}
    
    
    
    /**
     *  To User Friendly String
     *  	- Turns the date into a String with a user-friendly
     *  	  format
     *  
     *  Parameters
     *		- n/a
     *	
     *	Returns
     *		- String: MMM DD, YYYY
     */
	public String toUserFriendlyString() {
		String result;
		
		switch ( this.month ) {
			case 1:		result = "January "; break;
			case 2:		result = "February "; break;
			case 3:		result = "March "; break;
			case 4:		result = "April "; break;
			case 5:		result = "May "; break;
			case 6:		result = "June "; break;
			case 7:		result = "July "; break;
			case 8:		result = "August "; break;
			case 9:		result = "September "; break;
			case 10:	result = "October "; break;
			case 11:	result = "November "; break;
			case 12:	result = "December "; break;
			default:	return "";
		}
		
		result = result.concat( this.day + ", " + this.year );
		
		return result;
	}
	
	
	
	/**
	 * Getters
	 */
	
	public int getYear() {
		return this.year;
	}
	
	public int getMonth() {
		return this.month;
	}
	
	public int getDay() {
		return this.day;
	}
	
	
	
	/**
	 * Setters
	 */
	
	public void setYear(int year) {
		this.year = year;
	}
	
	public void setMonth(int month) {
		this.month = month;
	}
	
	public void setDay(int day) {
		this.day = day;
	}
}
